URL to the remote data source.

<div class="definition">
    String or Object, default = ''
</div>

If the <span class="method">.url</span> property is defined and <a class="argument" href="w2form.recid">.recid</a> property is defined,
the form will attempt to load record from the remote data source. The data will be loaded into the
<a class="argument" href="w2form.record">.record</a> object and a copy into <a class="argument" href="w2form.original">.original</a> object.
<div style="height: 10px"></div>

The <span class="method">.url</span> property can also be an object that defines different URL for get and save. For example:
<textarea class="javascript">
url: {
    get: '/url/to/get-record',
    save: '/url/to/save-record'
}
</textarea>
<div style="height: 10px"></div>

See also <a class="argument" href="w2form.dataType">.dataType</a> property to control how data will be passed to the server.
<div style="height: 10px"></div>

You can defined URL as a string:
<textarea class="javascript">
let form = new w2form({
    name: 'form',
    recid: 10,
    url: '/server/url',
    formURL: '/server/path',
    fields: [
        { field: 'first_name', type: 'text', required: true },
        { field: 'last_name', type: 'text', required: true },
        { field: 'email', type: 'email' }
    ],
    record: {
        first_name : 'John',
        last_name  : 'Doe',
        email      : 'jdoe@email.com'
    },
    actions: {
        "save": function () { this.validate(); },
        "reset": function () { this.clear(); }
    },
    postData: [
        param1 : 'value1',
        param2 : 'value2'
    ]
});
</textarea>

Or you can defined different URL for retrieving and saving the record:
<textarea class="javascript">
let form = new w2form({
    name: 'form',
    recid: 10,
    url: {
        get: '/server/url/to/get',
        save: '/server/url/to/save'
    },
    formURL  : '/server/path',
    fields: [
        { name: 'first_name', type: 'text', required: true },
        { name: 'last_name', type: 'text', required: true },
        { name: 'email', type: 'email' }
    ],
    record: {
        first_name    : 'John',
        last_name     : 'Doe',
        email         : 'jdoe@email.com'
    },
    actions: {
        "save": function () { this.validate(); },
        "reset": function () { this.clear(); }
    },
    postData: [
        param1 : 'value1',
        param2 : 'value2'
    ]
});
</textarea>

You can change this property during run-time
<textarea class="javascript">
w2ui.form.url = 'another/server/url';
w2ui.form.reload();
</textarea>

<h3>JSON Structures</h3>

If the <a class="argument" href="w2form.recid">.recid</a> property is not set, no request will be made. Otherwise, the form will submit the
following JSON structure;

<textarea class="javascript">
{
    action: 'get',  // command
    name: 'form',   // name of the form
    recid: XX       // recid of the form
}
</textarea>
Plus any additional parameters you specified in <a href="w2form.postData" class="property">.postData</a> object. The form will expect back a
JSON structure in the following format:
<textarea class="javascript">
{
    error: false,
    record: {
        field1 : value1,
        ...
        fieldN : valueN
    }
}
</textarea>
where field1 should match the names in <a href="w2form.fields" class="property">.fields</a> property.
<div style="height: 10px"></div>

If you want to return an error, you can return it in the following format:
<textarea class="javascript">
{
    error: true,
    message: 'Error message'
}
</textarea>

If you call the <a href="w2form.save" class="method">.save()</a> method the form will submit the following JSON structure:

<textarea class="javascript">
{
    action: 'save',  // command
    name: 'form',           // name of the form
    recid: XX,              // recid of the form
    record: {               // record of the form
        field1 : value1,
        ...
        fieldN : valueN
    }
}
</textarea>
